package cc.rengu.igas.bsps.common.enums;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zhangxuran on
 */
public enum EncryTxnInfoEnum {


    T00BS080_PHONE("T00BS080", "phoneNo", "手机号"),
    T00BS005_PHONE("T00BS005", "mobileNo", "手机号"),

    ;

    private String txnNum;
    private String txnField;
    private String fieldDesc;

    EncryTxnInfoEnum(String txnNum, String txnField, String fieldDesc) {
        this.txnNum = txnNum;
        this.txnField = txnField;
        this.fieldDesc = fieldDesc;
    }

    public String getTxnNum() {
        return txnNum;
    }

    public void setTxnNum(String txnNum) {
        this.txnNum = txnNum;
    }

    public String getTxnField() {
        return txnField;
    }

    public void setTxnField(String txnField) {
        this.txnField = txnField;
    }

    public String getFieldDesc() {
        return fieldDesc;
    }

    public void setFieldDesc(String fieldDesc) {
        this.fieldDesc = fieldDesc;
    }

    public static List<EncryTxnInfoEnum> decodeTxnInfo(String txnNum) {
        List<EncryTxnInfoEnum> txnInfoEnums = new ArrayList<>();
        for (EncryTxnInfoEnum encryTxnInfoEnum : EncryTxnInfoEnum.values()) {
            if (txnNum.equals(encryTxnInfoEnum.getTxnNum())) {
                txnInfoEnums.add(encryTxnInfoEnum);
            }
        }
        return txnInfoEnums;
    }
}
